package com.fenqing.comics.tasks;

import com.fenqing.comics.commons.Constant;
import com.fenqing.comics.service.ICrawlerService;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 国家漫画馆定时任务
 * @author fenqing
 */
@Component
@Slf4j
@Setter(onMethod_ = @Autowired)
public class ComicsTask {

    private ICrawlerService iCrawlerService;

    /**
     * 启动国家漫画馆爬虫
     */
    @Scheduled(fixedRate = Constant.COUNTRY_CRAWLER_INTERVAL)
    public void start() {
        this.iCrawlerService.start();
    }

}
